package com.baiwei.vpnapi.utils;

import com.baiwei.vpnapi.exception.BusinessEnum;
import com.baiwei.vpnapi.vo.ResultVo;

/**
 * @program: vpnapi
 * @description: 返回帮助类
 * @author: Mr. Stone
 * @create: 2020-02-27 00:21
 **/

public class ResultVoUtils {
    public static ResultVo success(Object data) {
        ResultVo vo = new ResultVo();
        vo.setCode(0);
        vo.setMsg("success");
        vo.setData(data);
        return vo;
    }
//    public static ResultVo fail(BusinessEnum err){
//        ResultVo vo = new ResultVo();
//        vo.setCode(err.getCode());
//        vo.setMsg(err.getMsg());
//        return vo;
//    }

    public static ResultVo fail(String msg, int code){
        ResultVo vo = new ResultVo();
        vo.setCode(code);
        vo.setMsg(msg);
        return vo;
    }
}
